package com.example.demo;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import java.util.Arrays;
import java.util.Collection;

@RunWith(value = Parameterized.class)
public class Junit4Test2 {

    private int len;
    private int val;

    public Junit4Test2(int length, int value) {
        len = length;
        val = value;
    }


    @Parameters
    public static Collection<Object[]> dataProvider() {

        Object[][] data = new Object[][]{{3, 5},
                                         {8, 10}};
        return Arrays.asList(data);
    }

    /**
     * junit4 parameter test
     */
    @Test
    public void parameterizeTest() {

        Assert.assertEquals(len + 2, val);
    }
}
